graph LR
    subgraph "Core Components"
        subgraph "Agent Runtime"
            RT[Runtime Core]
            RE[Reasoning Engine<br/>• Query<br/>• Analysis<br/>• Synthesis<br/>• Planning<br/>• Execution]
            PM[Persona Manifest]
        end

        subgraph "Credit System"
            LS[Ledger Service<br/>:8080]
            AC[Accounts]
            TR[Transactions]
        end

        subgraph "Memory System"
            MS[Memory Store<br/>TF-IDF]
            EL[Event Logs]
            LR[Log Rotator]
        end

        subgraph "Governance"
            TM[Task Manager]
            CO[Comments]
        end
    end

    subgraph "Data Flow"
        direction TB
        D1[Task Request] --> D2[Credit Check]
        D2 --> D3[Memory Retrieval]
        D3 --> D4[Reasoning]
        D4 --> D5[Response]
        D5 --> D6[Event Logging]
    end

    %% Core connections
    RT --> RE
    RT --> LS
    RT --> MS
    PM --> RT

    %% Credit system
    LS --> AC
    LS --> TR
    AC -.-> TR

    %% Memory system
    MS --> EL
    EL --> LR
    RE --> MS

    %% Governance
    TM --> EL
    CO --> EL
    TM --> LS

    %% Cross-component
    RT --> TM
    LR --> EL

    style RT fill:#4fc3f7
    style RE fill:#81c784
    style LS fill:#ba68c8
    style MS fill:#ffb74d
    style TM fill:#ff8a65
    style EL fill:#90a4ae